Is there a way to get something like $player.origin when a player spawns and when a player dies? The goal is to check if a player died within x units of his spawn within x seconds, then punish local.attacker. I was looking for something that could be easily applied to any map (aka not pulling playerinfo cords from every bsp to get possible coords of spawn points).
Was maybe thinking something like this? (go to the killed thread. that's where I'm completely lost)
Main: if(level.protect_punish) end level.protect_punish = 1 local.result = registerev "kill" global/protectpunish.scr::killed self.protected_punish = 1 self.protecting_punish = 1 local.timer_old_punish = 10; local.timer_punish = ( local.timer_old_punish * 100 ); local.time_punish = 0; local.allowed_time_old_punish = 1; local.allowed_time_punish = ( local.allowed_time_old_punish * 100 ); self thread check_death_punish while( (self != NIL) || (self != NULL) || (self.protecting_punish == 1) ) { if( (local.time_punish == local.timer_punish) || (self.fireheld == 1) ) { if(local.time_punish > local.allowed_time_punish) { self.protecting_punish = 0 end } } wait 0.01; local.time_punish ++; } end check_death_punish: local.a = 1 local.team = self.dmteam while(local.a) { if(self) { if( (self.dmteam != local.team) || (self.health <= 0) ) { self.protected_punish = 0 local.a = 0 } } else { local.a = 0 } wait 1 } end killed local.attacker local.damage local.inflictor local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.player: if(local.player.classname == "Player" && local.attacker.classname == "Player") { // These are the lines where it is obvious I have no idea what I'm doing --- local.spawnedat = $player.origin // does this pull a cord from spawn location? local.diedat = local.position // position takes vector pos, does that mean where you died?? local.safezone = spawn trigger_multiple // do you have to spawn a trigger to set the size of something? logically not sure how else it would work local.safezone.origin = local.spawnedat // how do I tell the script to take local.player.spawnedat? I only want to see where the dead player spawned to reference local.safezone setsize ( -200 -200 -10 ) ( 200 200 10 ) // -------------------------- if(local.player.protected_punish == 1) && local.dieat istouching local.safezone // positive this isn't correct syntax. It's the only way I know how to convey the idea in my head though. Hopefully someone who knows what they're doing can help put this into a syntax that actually works :/ { local.attacker iprint "Spawn killing is not allowed" local.attacker=parm.other // also, does this even work? I have a feeling this is incorrect. local.attacker hurt 50 local.attacker takeall local.attacker give models/weapons/colt45.tik local.attacker useweaponclass pistol } } end



Reply With Quote

